import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/index',
            component: () => import('../components/page/home.vue'),
            children: [
                {
                    path: '/index',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/nav/index.vue')
                },
                {
                    path: '/JobHunting',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/nav/JobHunting.vue')
                },
                {
                    path: '/connection',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/info/connection.vue')
                },
                {
                    path: '/Popularenterprises',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/index/Popularenterprises.vue')
                },
                {
                    path: '/JobHunting/jobdetail',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/jobdetail.vue')
                },
                {
                    path: '/TransactionAgent',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/nav/TransactionAgent.vue')
                },
                {
                    path: '/PartyMembers',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/nav/PartyMembers.vue')
                },
                {
                    path: '/affairs',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/nav/affairs.vue')
                },
                {
                    path: '/jobFair',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/jobFair/jobFair.vue')
                },
                {
                    path: '/jobFairDetails',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/jobFair/jobFairDetails.vue')
                },
                {
                    path: '/infoDetail',
                    component: () => import('../components/page/info/infoDetail.vue')
                },
                {
                    path: '/infoList',
                    component: () => import('../components/page/info/infoList.vue')
                    // children:[
                    //     {
                    //         path: '/infoDetail',
                    //         name:'infoDetail',
                    //         component: () => import('../components/page/info/infoDetail.vue')
                    //     },
                    // ]
                },
                {
                    path: '/resumeDeliveredSuccess',
                    component: () => import('../components/page/nav/resumeDeliveredSuccess.vue') // 简历投递成功
                }
            ]
        },
        {
            path: '/sec',
            component: () => import('../components/home/search.vue')
        },
        // {
        //     path: '/',
        //     component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
        //     meta: { title: '自述文件' },
        //     children: [
        //         {
        //             // 国际化组件
        //             path: '/i18n',
        //             component: () => import(/* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
        //             meta: { title: '国际化' }
        //         },
        //         {
        //             path: '/404',
        //             component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
        //             meta: { title: '404' }
        //         },
        //         {
        //             path: '/403',
        //             component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
        //             meta: { title: '403' }
        //         },
        //     ]
        // },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: {
                title: '登录'
            }
        },
        {
            path: '/resumeCreat',
            component: () => import(/* webpackChunkName: "resumeCreat" */ '../components/resume/create.vue'),
            meta: {
                title: '注册'
            }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ],
    scrollBehavior(to, from, savedPosition) {
        // return 期望滚动到哪个的位置
        return {
            x: 0,
            y: 0
        };
    }
});
